package com.zyl.blog.common.domain.file.bean;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * @version v1.0
 * @ProjectName: Personal_Blog_Server
 * @Package: com.zyl.blog.common.domain.file.bean
 * @ClassName: StorageConfig
 * @Description: 存储配置表
 * @Author FinalFantasy
 * @Date 2025/8/14-09:21
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName("storage_config")
public class StorageConfig {
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @JsonProperty("id")
    private Long id;

    /**
     * 存储类型（local, s3, oss等）
     */
    @TableField("storage_type")
    @JsonProperty("storageType")
    private String storageType;

    /**
     * 配置键
     */
    @TableField("config_key")
    @JsonProperty("configKey")
    private String configKey;

    /**
     * 配置值
     */
    @TableField("config_value")
    @JsonProperty("configValue")
    private String configValue;

    /**
     * 是否加密：0-否，1-是
     */
    @TableField("is_encrypted")
    @JsonProperty("isEncrypted")
    private Integer isEncrypted;

    /**
     * 配置描述
     */
    @TableField("description")
    @JsonProperty("description")
    private String description;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(value = "createTime", access = JsonProperty.Access.READ_ONLY)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonProperty(value = "updateTime", access = JsonProperty.Access.READ_ONLY)
    private LocalDateTime updateTime;

    /**
     * 更新人ID
     */
    @TableField("updated_by")
    @JsonProperty("updatedBy")
    private Long updatedBy;
}